import { IsArray, IsNotEmpty, IsOptional, MaxLength } from 'class-validator'
import i18n, { i18nMessage } from '@/i18n'
import { ApiProperty } from '@nestjs/swagger'
import { MetaResourceModelBatchSaveItemDto } from '../../meta-resource-model/dto/meta-resource-model-batch-save.dto'

export class MetaResourceChartSaveDto {
  @ApiProperty({ description: i18n.t('app-meta.dto.meta-resource-chart-save.30694100-0'), type: String })
  @IsNotEmpty()
  @MaxLength(64, { message: i18nMessage() })
  name: string

  @ApiProperty({ description: i18n.t('app-meta.dto.meta-resource-chart-save.30694100-1'), type: String })
  @IsNotEmpty()
  @MaxLength(64, { message: i18nMessage() })
  label: string

  @ApiProperty({ description: i18n.t('app-meta.dto.meta-resource-chart-save.30694100-2'), type: String })
  @IsNotEmpty()
  @MaxLength(64, { message: i18nMessage() })
  platform: string

  @ApiProperty({ description: i18n.t('app-meta.dto.meta-resource-chart-save.30694100-3'), type: String })
  @MaxLength(64, { message: i18nMessage() })
  @IsOptional()
  project?: string

  @ApiProperty({ description: i18n.t('app-meta.dto.meta-resource-chart-save.30694100-4') })
  @IsArray()
  requestModels?: MetaResourceModelBatchSaveItemDto[]
}
